\section{Module description}

In this section we are describing every module of our software.  This one has been split into two parts:
\begin{enumerate}
\item the software part, which correspond to the ambulance dispatching system;
\item the environment simulation part, which simulate a world where incidents occur, where witnesses signal them to the dispatching system and where ambulances move or disappear.
\end{enumerate}


\begin{figure}[h!]
\centering
\includegraphics[scale=0.5]{images/USE&Export.pdf}
\caption{Logical links between the modules.}
\label{logical}
\end{figure}


\begin{figure}[h!]
\centering
\includegraphics[scale=0.5]{images/Call&Activate.pdf}
\caption{Physical links between the modules.}
\label{physical}
\end{figure}

The logical and physical links between these modules are illustrated respectively on the figures \ref{logical} and \ref{physical}.

\subsection*{Software}

\begin{module}{Assigner}
Chooses an ambulanceInfo and an emergencyInfo and creates an assignment relation (see object model) between them.
\begin{operations}
\op{AssignAmbulance}
\op{DequeueEmergency}
\end{operations}
\secret{Choice of the emergency and of the ambulance.}

\end{module}

\begin{module}{FormRecorder}
Encodes the forms as emergencyInfos and store them in the emergency database.  Avoids duplicate emergencies.
\begin{operations}
\op RegisterCall 
\op EnqueueEmergency 
\end{operations}
This module uses a complementary module in order to detect the duplicate emergency.
\secret{Conversion of a form into an emergencyInfo.}
\end{module}

\begin{module}{DuplicateDetection}
Checks whether a received emergencyInfo describes the same emergency as another one in the emergency database.
\begin{operations}
\op DetectDuplicates [unspecified]
\end{operations}
\secret{Criteria of similarity between emergencies.}
\end{module}

\begin{module}{Map}
Contains information about roads and traffic.
\begin{operations}
\op ComputeDistanceBetween (undefined)
\end{operations}
\secret{Criteria of the best path to go to the emergency.}
\end{module}


\begin{module}{AssignmentManager}
This module assign team to an emergency. It takes care that the team arrived on place.
If the ambulance can't do the emergency, this module assigns another team.
See Achieve[CorrectAmbulance ArrivedOnPlace When CallRegistered]
\secret{How to manage and assign ambulance.}
\end{module}


\begin{module}{InterventionController}
%%Module description here
Checks whether the intervention is finished or failed.
\begin{operations}
%%Operations with \op{}
\op{GetInterventionStatus [Not specified]}  
\op{FinishER}
\end{operations}
\secret{How the module checks the current status of an emergency and the criteria for a finished or failed intervention}
\end{module}

\begin{module}{TeamNotifier}
Module used to notify the team of an emergency and to get the responses from
the crew.
\begin{operations}
%%Operations with \op{}
\op{AckCrewReady}
\op{NotifyTeam}
\end{operations}
\secret{By which means the team is notified and responds}
\end{module}

\begin{module}{TeamContacter}
Module that handles communication between crew and system. 
\begin{operations}
%%Operations with \op{}
\op{ContactTeam} 
\end{operations}
\secret{Communication protocol used}
\end{module}

\begin{module}{AmbulanceManager}
Keeps track information about all the ambulances in the system.
\begin{operations}
%%Operations with \op{}
\op{RecordAmbulance}
\op{GetAmbulanceStatus[Not specified]}
\end{operations}
\secret{How the information about ambulances is stored in the system.}
\end{module}


\begin{module}{Radio}
Sends information about the ambulance to the AmbulanceManager.
\begin{operations}
%%Operations with \op{}
\op{TransmitAmbulanceInfo}
\end{operations}
\secret{The communication way and protocol with the MDT.}
\end{module}


\begin{module}{Database}
%%Module description here
Provides persistence and access to information of the software. ACID properties are supposed to be guaranteed.
Contains all the information about emergencies and ambulances
\secret{Hides how information is kept in memory and how to access it}
\end{module}


\begin{module}{MDT}
%%Module description here
Gathers information about the ambulance (from the speedometer: speed; from the GPS: position) and about the status of the crew to send it to the radio.
\begin{operations}
%%Operations with \op{}
\op{FinishMission} 
\op{Login} 
\op{Logout} 
\op{SetBusy}
\op{GetAmbulanceInformation [unspecified]}
\end{operations}
\secret{Hides how operations modifying the crew attributes are done.}
\end{module}

\begin{module}{GPS}
%%Module description here
Provides a way to know the ambulance positions.
\begin{operations}
%%Operations with \op{}
\op{GetAmbulancePosition [unspecified]}
\end{operations}
\secret{How the positions of the ambulances are retrieved}
\end{module}


\begin{module}{Speedometer}
%%Module description here
Provides a way to know what the respective speeds of the ambulances is.
\begin{operations}
%%Operations with \op{}
\op{GetAmbulanceSpeed [unspecified]}
\end{operations}
\secret{Hides how the speed of an ambulance is computed.}
\end{module}

\begin{module}{MDTscreen}
%%Module description here
Displays the emergency information to the crew assigned to this emergency.
\begin{operations}
%%Operations with \op{}
\op{DisplayInformation [unspecified]}
\end{operations}
\secret{The information to display and how to display it.}
\end{module}

\subsection*{Environment}

\begin{module}{EnvironmentDatabase}
%%Module description here
Provides persistence and access to information of the database. ACID properties are supposed to be guaranteed.
Contain information about the environment ( position of simulated ambulances, emergencies, obstacles,...)
\secret{Hides how the information is stocked and how to retrieve it.}
\end{module}


\begin{module}{Simulator}
%%Module description here
Simulate the environment.  Corresponds to a high level goal of the simulator part: "WorldSimulated".
\secret{How to put together parts of environment scenario and run it.}
\end{module}

\begin{module}{GUIMap}
%%Module description here
Displays the environment based on the information stored in the environment database.
\op DisplayEnvironment
\secret{Choice of information displayed}
\end{module}


\begin{module}{EmergencyGenerator}
%%Module description here
Generates emergencies.
\secret{How to chose what kind of emergency to start, and where it will start.}
\end{module}

\begin{module}{I/O}
%%Module description here
Creates a scenario for the simulation based on information about the environment.
\op CreateScenario
\secret{How the scenario is built}
\end{module}

\begin{module}{AmbulanceSimulator}
%%Module description here
Simulates the ambulances.
\begin{operations}
%%Operations with \op{}
\op{CreateAmbulance} 
\op{CrashAmbulance}
\op{MoveAmbulance}
\end{operations}
\secret{How an ambulance is generated,how they are removed from the environment or how they move}
\end{module}

\begin{module}{Witness}
%%Module description here
Fires new emergencies.
\begin{operations}
%%Operations with \op{}
\op{CreateEmergencyCharacteristics}
\end{operations}
\secret{The data alteration.}
\end{module}
